<?php
header("Content-Type: text/html; charset=ISO-8859-1", true);
//gambiarra para o IECA;
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');  
header('Last Modified: '. gmdate('D, d M Y H:i:s') .' GMT');  
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');  
header('Pragma: no-cache');  
header("Cache: no-cache");    
header('Expires: 0');  
$campo=(String) $_GET['campo'];
$valor=(String) trim($_GET['valor']);
$tipo_busca=(String) $_GET['tipo_busca'];
$visao=(String) $_GET['visao'];
$l=include_once('conexao.php');
$sql_CNAE="Select * from $visao where $campo "."$tipo_busca"."'$valor'";
$result=mysql_query($sql_CNAE);
if (mysql_num_rows($result)==0){
    echo "NF";
    return;
}
while($row=mysql_fetch_row($result)){
        foreach ($row as $valor){
             echo "$valor"."\n";
        }
}
?>
